﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;

namespace supermarket.method
{
    internal class Classgetsql
    {
        //string s = "Data Source=DESKTOP-89MAGV5;database=super;uid=sa;pwd=123456";
        //string s = "Data Source=.\\SQLSERVER2022;Initial Catalog=super;Integrated Security=True;";
        string s = "Data Source=.\\SQLSERVER2022;Initial Catalog=super;Integrated Security=True;Trusted_Connection=True;MultipleActiveResultSets=True;";
        public static string connectstr = "Data Source=.\\SQLSERVER2022;database=super;Trusted_Connection=True;MultipleActiveResultSets=True;";
        SqlConnection con;  //创建数据库连接对象
        public SqlConnection getcon()
        {
            con = new SqlConnection(s);
            con.Open();
            return con;
        }
    }
}
